import javax.swing.*;
import java.awt.*;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-21
 * Time:14:49
 */
public class Text1 {
    public static void main(String[] args) {
        Text1 fw=new Text1();
        fw.go1();
    }
    public void go()
    {
        JFrame frame=new JFrame();
        JPanel panel=new JPanel();
        panel.setBackground(Color.darkGray);

        JButton fw1=new JButton("游戏开始");
        JButton fw2=new JButton("游戏结束");

        panel.add(fw1);
        panel.add(fw2);

        frame.getContentPane().add(BorderLayout.EAST,panel);
        frame.setSize(500,500);
        frame.setVisible(true);
    }
    public void go1()
    {
        JFrame frame=new JFrame();
        JPanel panel=new JPanel();
        panel.setBackground(Color.darkGray);

        panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
        JButton fw1=new JButton("游戏开始");
        JButton fw2=new JButton("游戏结束");

        panel.add(fw1);
        panel.add(fw2);

        frame.getContentPane().add(BorderLayout.EAST,panel);
        frame.setSize(500,500);
        frame.setVisible(true);
    }

}
